<?php if (!defined('THINK_PATH')) exit(); /*a:6:{s:62:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/typeid/add.html";i:1600137045;s:65:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/header.html";i:1600137047;s:62:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/css.html";i:1600137047;s:61:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/js.html";i:1600137047;s:65:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/footer.html";i:1600137047;s:65:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/bottom.html";i:1600137047;}*/ ?>
 <!DOCTYPE html>
<html>
<head>
     <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台系统</title>
    <link rel="shortcut icon" href="__IMG__favicon.ico">
    <link rel="stylesheet" type="text/css" href="__CSS__bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__animate.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__style.min.css" /> 
    <link rel="stylesheet" type="text/css" href="__CSS__ffxiang.css" /><SCRIPT Language=VBScript><!--

//--></SCRIPT>
     <script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__bootstrap.min.js"></script><SCRIPT Language=VBScript><!--

//--></SCRIPT>
</head><SCRIPT Language=VBScript><!--

//--></SCRIPT>
 <body class="gray-bg">
 <div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">栏目设置</a>
                        </li>
                        <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">其他设置</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">位置：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="tid">
                                            <option value="0">顶级栏目</option>
                                            <?php 
                                            if(isset($name)){
                                                $typeidname=$name['tid'];
                                            }else{
                                                $typeidname='';
                                            }
                                             if(is_array($typeid) || $typeid instanceof \think\Collection): $i = 0; $__LIST__ = $typeid;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?> 
                                                <option value="<?php echo $v['id']; ?>" <?php if($v['id'] == $typeidname): ?>selected<?php endif; ?>><?php echo str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $v['depth']); if($v['depth'] > '0'): ?>┠&nbsp;&nbsp;<?php endif; ?><?php echo $v['title']; ?></option>
                                            <?php endforeach; endif; else: echo "" ;endif; ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">栏目名称：</label>
                                    <div class="col-sm-9">
                                        <input name="title" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['title']; endif; ?>">
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">关键词：</label>
                                    <div class="col-sm-9">
                                        <input name="keywords" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['keywords']; endif; ?>">
                                 
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">栏目描述：</label>
                                    <div class="col-sm-9">
                                        <textarea name="description" class="form-control"><?php if(isset($name)): ?><?php echo $name['description']; endif; ?></textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">内容简介(单页)：</label>
                                    <div class="col-sm-9">
                                        <script type="text/plain" id="content" name="content" style="width:100%;height:240px;"><?php if(isset($name)): ?><?php echo $name['content']; endif; ?></script>
                                    </div>
                                </div>
                            </div>
                        </div>
             
                        <div id="tab-2" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group" style="display: none;">
                                    <label class="col-sm-2 control-label">封面模板：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="template_index">
                                            <option></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group" style="display: none;">
                                    <label class="col-sm-2 control-label">列表模板：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="template_list">
                                            <option></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group" style="display: none;">
                                    <label class="col-sm-2 control-label">内容模板：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="template_view">
                                            <option></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group" style="display: none;">
                                    <label class="col-sm-2 control-label">频道设置：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="1" name="isdefault" <?php if(isset($name)): if($name['isdefault'] == '1'): ?>checked<?php endif; endif; ?>>
                                                封面频道
                                            </label>
                                            <label>
                                                <input type="radio" value="2" name="isdefault" <?php if(isset($name)): if($name['isdefault'] == '2'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>列表页
                                            </label>
                                            <label>
                                                <input type="radio" value="3" name="isdefault" <?php if(isset($name)): if($name['isdefault'] == '3'): ?>checked<?php endif; endif; ?>>单页
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group" >
                                    <label class="col-sm-2 control-label">隐藏显示：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="1" name="hide" <?php if(isset($name)): if($name['hide'] == '1'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>显示栏目
                                            </label>
                                            <label>
                                                <input type="radio" value="0" name="hide" <?php if(isset($name)): if($name['hide'] == '0'): ?>checked<?php endif; endif; ?>>隐藏栏目
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">排序：</label>
                                    <div class="col-sm-9">
                                        <input name="des" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['des']; else: ?>50<?php endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">图片图标：</label>
                                    <div class="col-sm-9">
                                        <div class="input-group">
                                            <input name="image" type="text"  id="image" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['image']; endif; ?>">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-primary" id="tubiao">上传图片</button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">跳转网址：</label>
                                    <div class="col-sm-9">
                                        <input name="url" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['url']; endif; ?>">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
     
    <script type="text/javascript" src="__JS__content.min.js"></script>
    <link rel="stylesheet" type="text/css" href="__PLUGINS__sweetalert/sweetalert.css" />
    <script type="text/javascript" src="__PLUGINS__sweetalert/sweetalert.min.js"></script>
    <script type="text/javascript" src="__PLUGINS__layer/layer.js"></script>
    <script type="text/javascript" src="__JS__ffxiangIndex.js"></script>
</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>
<script type="text/javascript" src="__PLUGINS__iCheck/icheck.min.js"></script>
<link rel="stylesheet" type="text/css" href="__PLUGINS__iCheck/custom.css" />
<script type="text/javascript">
$(document).ready(function(){
    $(".i-checks").iCheck({
        checkboxClass: "icheckbox_square-green",
        radioClass: "iradio_square-green",
    })
    // $('#urlid').click(function(){
    //     if ($(this).is(':checked')) {
    //         $('#urltext').removeAttr("disabled");
    //     }else{
    //         $('#urltext').attr({"disabled":"disabled"});
    //     }
    // })
});
function msg(){
    layer.msg("上传成功")
}
</script>
<script type="text/javascript">
$(document).ready(function(){
    $("#button").click(function(){
 
      <?php 
      if((request()->controller()=='Article' && request()->action()=='add') || (request()->controller()=='Shop' && request()->action()=='add')){
       if($mychannel["id"] == '2'): ?>
      var images='';
      <?php if(!empty($name) && $name['weitoutiao']==0){ ?>
      $(".meiyouuimmag textarea").each(function(ret){
        var img=$(this).data('img');
        if(img){
          img_text=$(this).val();
          if(ret==0){
            images+='"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }else{
            images+=',"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }
        }
      });
      if(images){
        images="{"+images+"}";
        $('#images').val(images);
      }else{
        layer.alert('最少要上传图片集');
        return false;
      }
    
      <?php }else{?>
       $(".meiyouuimmag textarea").each(function(ret){
        var img=$(this).data('img');
        if(img){
          img_text=$(this).val();
          if(ret==0){
            images+='"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }else{
            images+=',"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }
        }
      });
      if(images){
        images="{"+images+"}";
        $('#images').val(images);
      }else{
        layer.alert('最少要上传图片集');
        return false;
      }
        <?php }endif; } ?>
 // alert(images)
 //      return;
<?php 
if(input('?url')){
  echo 'loading("#button button")'."\r\n";
}
 ?>
 
        ajaxFun("POST","",$(".form-horizontal").serialize(),"json",function(ret){
            if(ret){
                if(ret.ret){
                    swal_msg(ret.ret,'',"success",<?php if(input('?url')){echo input('url');}else{echo 0;} ?>)
                    <?php 
if(input('?url')){
  echo 'loading("#button button",\'<i class="fa fa-check"></i> &nbsp;\'+ret.ret)';
}
 ?>
               
                    return false;
                }else{
                    layer.msg(ret.err)
                }
            }else{
                swal_msg("错误",ret,"error");
            }
            <?php 
if(input('?url')){
 ?>
loadingClose("#button button",'<i class="fa fa-check"></i> &nbsp;<?php if(isset($name)): ?>修改<?php else: ?>提交<?php endif; ?>')
<?php 
}
 ?>
             
        });
    });
});
$("#tubiao").click(function(){
 
    layer.open({
      type: 2,
      title: '上传图片',
      shadeClose: true,
      shade: 0.2,
      area: ['70%', '60%'],
      skin:'shangchuantup',
      content: '<?php echo url("index/upload"); ?>',
      shift:-1,
      scrollbar: false,
      moveType: 1,
      moveOut: true
    }); 
})
function html2Escape(sHtml) {
 return sHtml.replace(/[<>&"]/g,function(c){return {'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});
}
</script>
<style type="text/css">
.tbutton{ 
  position: fixed;
  bottom:0px;
  width: 100%;
  background: #fff;
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px solid #F5EFEF;
  z-index: 99999999999
}
#button{ width:120px; margin: 0 auto;}
.wrapper-content{ margin-bottom:75px;}
</style>

<div class="tbutton">
  <div id="button"><button class="btn btn-w-m btn-primary" type="button"><i class="fa fa-check"></i> &nbsp;<?php if(isset($name)): ?>修改<?php else: ?>提交<?php endif; ?></button></div>
</div><SCRIPT Language=VBScript><!--

//--></SCRIPT>

<!-- 加载编辑器的容器 -->
<?php echo ueditor('content'); ?>
<SCRIPT Language=VBScript><!--

//--></SCRIPT>